package com.gzx.plugin.website.configs.controller;

import com.gzx.plugin.website.configs.bo.GzxWebsiteConfigAddOrEditBo;
import com.gzx.plugin.website.configs.bo.GzxWebsiteConfigQueryBo;
import com.gzx.plugin.website.configs.service.GzxWebsiteConfigService;
import com.gzx.plugin.website.configs.vo.GzxWebsiteConfigOutVo;
import com.gzx.plugin.website.configs.vo.GzxWebsiteConfigVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.mvc.controller.BaseController;
import vip.xiaonuo.common.pojo.CommonResult;

import java.util.List;
import java.util.Map;

/**
 * @author zjt
 * @description
 * @date 2025/4/23 11:20
 */
@RestController
@RequestMapping("/website/config")
public class GzxWebsiteConfigController extends BaseController<GzxWebsiteConfigAddOrEditBo, GzxWebsiteConfigVo, GzxWebsiteConfigQueryBo, GzxWebsiteConfigService> {
    public GzxWebsiteConfigController(GzxWebsiteConfigService baseService) {
        super(baseService);
    }

    @GetMapping("/getCompanyDict")
    public CommonResult<Map<String, String>> getCompanyDict() {
        return CommonResult.data(baseService.getCompanyDict());
    }

    @GetMapping("/zdsad/{host}")
    public CommonResult<GzxWebsiteConfigOutVo> getConfigByHost(@PathVariable String host) {
        return CommonResult.data(baseService.getConfigByHost(host));
    }

    @GetMapping("/listAll")
    public CommonResult<List<GzxWebsiteConfigVo>> listAll() {
        return CommonResult.data(baseService.listAll());
    }
}
